﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace zPod.zInject
{
    /// <summary>
    /// Attributes derived from InjectionAttributeBase indicate that
    /// there is code that should be executed after and/or before the 
    /// decorated method.
    /// </summary>
    public abstract class InjectionAttributeBase : Attribute
    {
        /// <summary>
        /// The highest priority injected attribute will be executed
        /// first in the BeforeExecute pipeline and last in the AfterExecute pipeline
        /// </summary>
        public virtual double Priority
        {
            get
            {
                return 1;
            }
        }

        /// <summary>
        /// This method is executed before the decorated method
        /// </summary>
        /// <param name="method">Decorated method</param>
        /// <param name="target">Target object</param>
        public abstract void BeforeExecute(string method, object target);

        /// <summary>
        /// This method is executed after the decorated method
        /// </summary>
        /// <param name="method">Decorated method</param>
        /// <param name="target">Target object</param>
        public abstract void AfterExecute(string method, object target);
    }
}
